<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>基本代码结构</title>
</head>

<body>
  <div>
    <p>1.创建store.js文件,安装Vuex</p>
    <p>2.导入Vue import Vue from 'vue'</p>
    <p>3.导入Vuex import Vuex from 'vuex'</p>
    <p>4.使用Vue.use注册插件 Vue.use(Vuex)</p>
    <p>5.导出 new Vuex.Store,代码示例在下</p>
    <p>6.在app.js中 导入 import store from './store'</p>
    <p>7.在创建Vue示例对象的时候传入</p>
  </div>
  <script>
    export default new Vuex.Store({
      state: {},
      mutations: {},
      actions: {},
      modules: {}
    })
  </script>
</body>

</html>